/**
 Copyright (C) 2013 Yuyao Liang

 This source code is release under the BSD License.

 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.  See the license for more details.

 Created on Oct 29, 2013 4:29:15 PM
 */
package com.googlecode.backtest.rule.action;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 * @author lianyuy
 * 
 */
@XmlRootElement(name = "BackTestActions")
@XmlType(name = "BackTestActionsType")
public class BackTestActions implements IBackTestActions {
	@XmlElement
	private List<IBackTestAction> actions = new ArrayList<IBackTestAction>();

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.googlecode.backtest.rule.action.IBackTestActions#add(com.googlecode
	 * .backtest.rule.action.IBackTestAction)
	 */
	@Override
	public void add(IBackTestAction action) {
		actions.add(action);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.googlecode.backtest.rule.action.IBackTestActions#get(int)
	 */
	@Override
	public IBackTestAction get(int index) {
		return actions.get(index);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.googlecode.backtest.rule.action.IBackTestActions#clear()
	 */
	@Override
	public void clear() {
		actions.clear();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.googlecode.backtest.rule.action.IBackTestActions#getCount()
	 */
	@Override
	public int getCount() {
		return actions.size();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.googlecode.backtest.rule.action.IBackTestActions#getIterator()
	 */
	@Override
	public Iterator<IBackTestAction> getIterator() {
		return actions.iterator();
	}

}
